function score = calculate_integral_weight(value, minValue, maxValue, coef, smallIsBetter)
    score_0 = 1;
    score_K = 10;
    
    if smallIsBetter
        score_0 = 10;
        score_K = 1; 
    end
    
    devider = (maxValue - minValue);
    if devider == 0 
        devider = 1;
    end
    
    tmp = (value - minValue) * (score_K - score_0);
    if tmp == 0
        tmp = 1;
    end
    
    score = (score_0 + tmp / devider) * coef;
end


